package cn.edu.cimv.service.impl;

import cn.edu.cimv.dao.entity.Project;
import cn.edu.cimv.dao.entity.Project;
import cn.edu.cimv.dao.mapper.ProjectMapper;
import cn.edu.cimv.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by 门铎 on 2016/6/27.
 */
@Service
public class ProjectServiceImpl implements ProjectService {
    @Autowired private ProjectMapper projectMapper;
    @Override
    public void editProject(Project project) {
        projectMapper.insertProject(project);
    }

    @Override
    public List<Project> queryProject() {
        return projectMapper.queryProject();
    }

    @Override
    public void deleteProject(int id) {
        projectMapper.deleteProject(id);
    }

    @Override
    public Project queryProjectById(int id) {
        return projectMapper.queryProjectById(id);
    }

    @Override
    public void updateProject(Project project) {
        projectMapper.updateProject(project);
    }
    @Override
    public void setLastProject(int id,int flag) {
        projectMapper.updateFlagById(id,flag);
    }
}
